package bootstrap;

import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import service.CalculateService;

@SpringBootApplication(scanBasePackages = "service")
public class CalculateServiceBootstrap {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = new SpringApplicationBuilder(CalculateServiceBootstrap.class)
                .web(WebApplicationType.NONE)
                .profiles("java7")
                .run(args);

        CalculateService service = context.getBean(CalculateService.class);
        System.out.println("calculateService.sum(1...10) :" +
        service.sum(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));

        context.close();

    }
}
